'''oto/player.py

This module contains the Player class.
'''

__authors__ = ['Ryan Rousseau <ryan.rousseau@gmail.com>']
__license__ = '''Oranges to Oranges
Copyright (C) 2006  Ryan Rousseau

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
'''

class Player(object):
    def __init__(self, name, key):
        self.name = name
        self.key = key
        self.hand = []
        self.trophies = []

    def add_trophy(self, card):
        self.trophies.append(card)

    def clear_hand(self):
        self.hand = []

    def deal_card(self, card):
        self.hand.append(card)

    def needs_cards(self, cards_per_hand):
        return cards_per_hand != len(self.hand)
